package com.hr.system.controller;

import com.github.pagehelper.PageInfo;
import com.hr.system.param.TableDataInfo;

import java.util.List;

public class BaseController {
    /**
     * 响应请求分页数据
     */
    @SuppressWarnings({ "rawtypes", "unchecked" })
    protected TableDataInfo getDataTable(List<?> list, List<?> totalList)
    {
        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(200);
        rspData.setMsg("查询成功");
        rspData.setRows(list);
        rspData.setTotal(new PageInfo<>(totalList).getTotal());
        return rspData;
    }
}
